<template>
	<view class="content">
		<image class="logo" src="/static/logo.png" @click="handle()"></image>
		<view class="text-area">
			<text class="title" @click="toSettingPage()">{{title}}</text>
		</view>

		<!-- 纵向滚动 -->
		<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
			@scrolltolower="lower" @scroll="scroll">
			<view id="demo1" class="scroll-view-item uni-bg-red">A</view>
			<view id="demo2" class="scroll-view-item uni-bg-green">B</view>
			<view id="demo3" class="scroll-view-item uni-bg-blue">C</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',

				// scroll-Y
				scrollTop: 0,
				old: {
					scrollTop: 0
				}
			}
		},
		onLoad() {},
		methods: {
			handle() {
				console.log("点击了");
			},
			toSettingPage() {
				uni.navigateTo({
					url: "/pagesMine/pages/minePage/setting/setting?id=1&name=小明"
				})
			},
			// scroll-Y
			upper: function(e) {
				console.log(e)
			},
			lower: function(e) {
				console.log(e)
			},
			scroll: function(e) {
				console.log(e)
				this.old.scrollTop = e.detail.scrollTop
			},
		},
		onPageScroll: function() {
			console.log("页面滚动了");
		},
	}
</script>

<style lang="scss">
	a{
		// bottom: ;
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.scroll-Y {
		min-height: 400px;
		height: 300rpx;
		
		$bc:(red,green,blue);
		@for $i from 1 through 3{
			#demo#{$i}{
				height: 300px;
				background-color: nth($bc,$i);
			}
			
		}
	}
</style>